package com.to8to.kitt.esb;

public class NodeChangeEvent {

	public String path;
	public byte[] odata;
	public byte[] ndata;
	
	public boolean isChange()
	{
		if(odata == null || ndata == null)
		{
			if(odata == null && ndata == null)
				return false;
			else 
				return true;
		}
		
		if(odata.length != ndata.length)
			return true;
		
		for(int i = 0 ; i < odata.length; ++ i)
		{
			if(odata[i] != ndata[i])
				return true;
		}
		
		return false;
	}
	
	public String toString()
	{
		String old = odata != null ? new String(odata) : "";
		String newd = ndata != null ? new String(ndata) : "";
		return "path:" + path + "\n-----------old------------\n" + old + "\n-----------new------------\n" + newd + "\n--------------------------";
	}
	
}
